package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.HotelComment;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.mapper.HotelCommentMapper;
import cn.wolfcode.trip.base.service.IHotelCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class HotelCommentServiceImpl implements IHotelCommentService {

    @Autowired
    private HotelCommentMapper commentMapper;
    public void saveOrUpdate(HotelComment entity) {
        entity.setReleaseTime(new Date());
        commentMapper.insert(entity);

    }

    public List<HotelComment> queryCommentByHotelId(Long hotelId) {

        return commentMapper.selectCommentByHotelId(hotelId);
    }
}
